package com.mayikt.days08;

/**
 * @ClassName Test001
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Test001 {
    private static ThreadLocal threadLocal = new ThreadLocal<String>();

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            threadLocal.set("mayikt");
            System.out.println("子线程缓存局部变量成功。。");
            System.out.println(Thread.currentThread().getName() + "," + threadLocal.get());
        });
        thread.start();
        thread.join();

    }
}
